<template>
  <el-carousel height="500">
      <div class="slide">
        <el-carousel-item v-for="(item, index) in props.slides" :key="index">
          <img :src="item.image" alt="">
          <h3>{{ item.title }}</h3>
          <p>{{ item.description }}</p>
        </el-carousel-item>
      </div>
  </el-carousel>
</template>

<script setup>
import { defineProps } from 'vue'

const props = defineProps({
  slides: {
    type: Array,
    required: true
  }
})

</script>

<style scoped>
.slide {
  position: relative;
  width: 100%;
  /*height: 400px;*/
  text-align: center;
  color: #fff;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
</style>